1. Field of the Invention
The invention relates to a technical field of network address translation (NAT) and, more particularly, to a NAT system for supporting mobile IP in private networks and its method.
2. Description of Related Art
In the Internet, an IP address is regarded as the location of a machine. Packet transferred in the Internet also uses IP addresses to represent the source and destination. Currently, IP technology widely used in the Internet is IP version 4, which uses 32-bit address. However, due to rapidly growing machine number but limited address length, available public IP addresses are insufficient gradually.
To overcome this, a NAT device is introduced to slow down the consumption of IP addresses and make regions having a shortage of IP addresses continue to work. However, with the introduction of the NAT device, IP losses its transparency. For example, the NAT device causes that mobile IP protocol cannot work normally. FIG. 1 is a schematic diagram of applying mobile IP to a private network 102 having a NAT device 14. As shown in FIG. 1, when a mobile node (MN) 11 moves from its home network 101 to a foreign private network 102, the mobile node 11 obtains a care-of address (CoA) (192.168.0.1) from a DHCP (Dynamic Host Configuration Protocol) server 13 in the private network 102. According to mobile IP protocol, the mobile node 11 registers to the home agent 12 in the home network 101 after obtaining the CoA. The mobile node 11 sends a registration packet 15 with a header containing a source address indicative of the CoA (192.168.0.1) and a destination address indicative of an address (120.105.1.1) of the home agent 12. The content of the registration packet 15 contains the CoA (192.168.0.1) where the mobile node locates. The registration packet 15 is processed by the NAT device 14 to translate the source address of the header from the CoA (192.168.0.1) into the public IP address (140.113.1.1) of the NAT device 14 for further sending the registration packet 15 to the home agent 12. The home agent 12 unpacks the content after receiving the registration packet 15 and thus knows that the mobile node 11 locates at the CoA (192.168.0.1). Next, the home agent 12 responds a registration reply packet 16 with a header containing a source address indicative of the address (120.105.1.1) of the home agent 12 and a destination address indicative of the public IP address (140.113.1.1) of the NAT device 14. Thus, the NAT device 14 translates the destination address from the public IP address (140.113.1.1) into the CoA (192.168.0.1) and the registration reply packet 16 is accurately sent to the mobile node, thereby completing the registration. Next, when the home agent 12 tunnels the data packet 17 to the mobile node 11, which is achieved by using the CoA (192.168.0.1) obtained in the registration as the destination address, the destination address (in this case, the CoA (192.168.0.1)) is a private address and cannot be sent by the home network 101 to the private network 102 accurately, thereby making mobile IP protocol out of work.
To overcome this, a direct solution is proposed in which, after the home agent 12 receives and unpacks the registration packet 15, it further determines if the address (CoA) of the mobile node 11 included in the unpacked content is the same as the source address of the packet 15. If the two addresses are different, it indicates that the registration packet 15 is processed by the NAT. In this case, after replying and completing the registration, the home agent 12 uses the source address of the original registration packet 15 (before the NAT) as the destination address for sending packets to the mobile node 11. Namely, the CoA of the mobile node 11 obtained by the content of the registration packet is not the destination address. Accordingly, data packet 17 is sent to the NAT device 14 for address translation and further to the mobile node 11. However, the cited solution requires translating different CoAs of mobile nodes or devices 11 into different public addresses so that the NAT device 14 can transfer data packets to the respective mobile nodes or devices 11 accurately. As such, it cannot save any public address.
Therefore, it is desirable to provide an improved method to mitigate and/or obviate the aforementioned problems.